<div class="wrapper-md" ng-controller="UserAddOrUpdateCtrl">
	<div class="panel panel-default">
		<ng-form name="roleAddForm" class="form-validation">
			<div class="panel-heading">
			  <h1 class="m-n font-thin h3"><span translate="{{vm.title}}"></span></h1>
			</div>
			<div class="panel-body">
				<div class="form-group ">
					<div class="col-sm-6">
						<label >
							<span class="text-danger">*</span>
							<span translate="user.zhanghao"></span>
						</label>
						<input type="text" name="name" class="form-control" name="account" id="accountID" 
								ng-model="vm.user.account"  
								ng-pattern="app.reg.account"
								maxlength="32" required ng-disabled="vm.isEdit"
								uib-tooltip="{{'common.op.remind1' | translate}}" />
					</div>
					<div class="col-sm-6">
						<label >
							<span class="text-danger">*</span>
							<span translate="user.yuangongbianhao"></span>
						</label>
						<input class="form-control" name="employeeCode" id="employeeCodeID" maxlength="32"
					 		ng-model="vm.user.employeeCode" required
					 		ng-pattern="app.reg.account" 
						 	uib-tooltip="{{'common.op.remind1' | translate}}"/>
					</div>
				</div>
				<div class="form-group ">
					<div class="col-sm-6">
						<label >
							<span class="text-danger">*</span>
							<span translate="user.yonghuming"></span>
						</label>
						<input type="text" name="name" class="form-control" name="name" id="nameID"
								ng-model="vm.user.name"  
								maxlength="32" required
								uib-tooltip="{{'common.op.remind2' | translate}}" />
					</div>
					<div class="col-sm-6">
						<label >
							<span class="text-danger">*</span>
							<span translate="user.youxiang"></span>
						</label>
						<input type="text" class="form-control" name="email" id="emailID"
					 		ng-model="vm.user.email" maxlength="128"
					 		required
					 		ng-pattern="app.reg.email"
						 	uib-tooltip="{{'user.youxiangjiaoyan' | translate}}"/>
					</div>
				</div>
				<div class="form-group " ng-if="!vm.isEdit">
					<div class="col-sm-6">
						<label >
							<span class="text-danger">*</span>
							<span translate="user.mima"></span>
						</label>
						<input type="password" class="form-control" name="password" id="passwordID"
					 		ng-model="vm.user.password" 
					 		required 
					 		minlength="{{vm.pwdRule.minLength}}"
					 		maxlength="{{vm.pwdRule.maxLength}}"
						 	uib-tooltip="{{app.getMessage('common.op.remind26',[vm.pwdRule.minLength,vm.pwdRule.maxLength,vm.pwdRule.minCharType])}}"/>
					</div>
					<div class="col-sm-6">
						<label >
							<span class="text-danger">*</span>
							<span translate="user.querenmima"></span>
						</label>
						<input type="password" class="form-control" name="pwdName" id="pwdID"
								ng-model="vm.user.pwdName"
								required 
								maxlength="20"
								ui-validate=" '$value==vm.user.password' " 
		   	 					ui-validate-watch=" 'vm.user.password' "
		   	 					uib-tooltip="{{'user.querenmimatishi' | translate}}" />
					</div>
				</div>
				<div class="form-group ">
					<div class="col-sm-6">
						<label >
							<span class="text-danger">*</span>
							<span translate="user.role"></span>
						</label>
						<ui-select multiple ng-model="vm.selectRoles" ui-validate=" '!app.isEmpty($value)' "
                                      theme="bootstrap" search-enabled="false" >
					      <ui-select-match placeholder="{{'common.select' | translate}}">{{$item.name}}</ui-select-match>
					      <ui-select-choices repeat="role in vm.roleList">
					        <div ng-bind-html="role.name"></div>
					      </ui-select-choices>
					    </ui-select>
					</div>
				</div>
				<div class="form-group ">
					<div class="col-sm-6">
						<label >
							<span translate="user.chuanzhen"></span>
						</label>
						<input type="text" class="form-control" name="fax" id="fax"
					 		ng-model="vm.user.fax" maxlength="16"
					 		ng-pattern="app.reg.fox"
						 	uib-tooltip="{{'user.chuanzhenjiaoyan' | translate}}"/>
					</div>
					<div class="col-sm-6">
						<label >
							<span translate="user.dianhua"></span>
						</label>
						<input type="text" class="form-control" name="telephone" id="telephID"
					 		ng-model="vm.user.telephone" 
					 		maxlength="32"
					 		ng-pattern="app.reg.phone"
						 	uib-tooltip="{{'user.dianhuajiaoyan' | translate}}"/>
					</div>
				</div>
				<div class="form-group ">
					<div class="col-sm-6">
						<label >
							<span translate="user.dizhi"></span>
						</label>
						<input type="text" class="form-control" name="address" id="address"
					 		ng-model="vm.user.address" maxlength="256"
						 	uib-tooltip="{{'common.op.remind6' | translate}}"/>
					</div>
					<div class="col-sm-6">
						<label >
							<span translate="common.remark"></span>
						</label>
						<textarea class="form-control" name="description" id="description"
					 		ng-model="vm.user.description" maxlength="256"
						 	uib-tooltip="{{'common.op.remind6' | translate}}"></textarea>
					</div>
				</div>
				<div class="form-group ">
					<div class="col-sm-6">
						<label >
								<span translate="user.suoshuqvyu"></span>
						</label>
						<div class="form-control h-auto">
					        <ul iss-ztree="vm.treeSetting" id="archTree" tree-control="vm.treeObj" 
								tree-data="vm.treeData" class="ztree"></ul>
						</div>
					</div>
				</div>
			</div>
			<footer class="panel-footer text-right bg-light lter">
				<button type="button" class="btn btn-default" ng-click="vm.cancel()" translate="common.cancel"></button>
				<button type="button" class="btn btn-primary" ng-click="vm.save()" ng-disabled="roleAddForm.$invalid" translate="common.confirm"></button>
	        </footer>
		</ng-form>
	</div>
</div>